//
//  CommonDefine.h
//  Pods
//
//  Created by zhd on 2023/6/20.
//
#import "CommonFunc.h"

#ifndef CommonDefine_h
#define CommonDefine_h

#define FC(LABLE,FONT,COLOR) \
LABLE.font = FONT; \
LABLE.textColor = COLOR;

#define BTN_FC(BTN,FONT,COLOR) [BTN setFont:FONT color:COLOR]
#define COLOR(V) [UIColor colorWithHex:@#V]
#define CA(V,A) [UIColor colorWithHex:@#V alpha:A]

#define SF(...) [NSString stringWithFormat:__VA_ARGS__]

#define F(X) FRegular(X)
#define FRegular(X) FB(X,UIFontWeightRegular)
#define FMedium(X)  FB(X,UIFontWeightMedium)
#define FSemibold(X) FB(X,UIFontWeightSemibold)
#define FBold(X) FB(X,UIFontWeightBold)
#define FHeavy(X) FB(X,UIFontWeightHeavy)
#define FBlack(X) FB(X,UIFontWeightBlack)
#define FB(X,Y) [UIFont fontLayout375XSize:X weight:Y]

#define IMAGE_NAME(name,bundleName) nibViewByNameAndBundleName(name, bundleName)
#define NIB_VIEW(name,bundleName)   nibViewByNameAndBundleName(name, bundleName)
#define NIB_CLASS(name,bundleName)  nibViewByNameAndBundleName(name, bundleName)
#define EXECUTE_BLOCK(block, ...) \
if(block != nil){ \
block(__VA_ARGS__); \
}

#define setWeakify(obj) __weak typeof(obj) weak##obj = obj;

#define setStrongify(obj) __strong typeof(obj) obj = weak##obj; \
if(weak##obj == nil) \
{ \
return; \
}
#endif /* CommonDefine_h */
